package com.grsu.TransportSystem.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.grsu.TransportSystem.dao.IPersonDAO;

@Service
public class WebStoreUserDetailsService implements UserDetailsService {

	@Autowired
	IPersonDAO personService;
	
	@Override
	@Transactional
	public UserDetails loadUserByUsername(String login)
			throws UsernameNotFoundException {
		return personService.findByLogin(login); 
	}

}
